<?xml version="1.0" encoding="UTF-8" ?>
<!--
File Name : attendManager.jsp
-->
<%@ page 	language="java" 	contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib 	prefix="s" 			uri="/struts-tags"%>

<html 		xmlns="http://www.w3.org/1999/xhtml">
<!-- ============================== BODY START ==============================-->
<head>
	<s:head theme="ajax" />
	<meta http-equiv="Content-Type" 	content="text/html; charset=UTF-8" />
	<meta http-equiv="pragma" 			content="no-cache" />
	<meta http-equiv="cache-control" 	content="no-cache" />
	<meta http-equiv="expires" 			content="0" />
	
	<title>지각 조회</title>
	
	<!-- --------------------J A V A S C R I P T-START-------------------- -->
    <script type="text/javascript">
    ////////////////////////달력////////////////////////////
        		function doOnLoad()
		{
			// 달력
			cal1 = new dhtmlxCalendarObject('e_date', false, {isYearEditable: true});
			cal1.setYearsRange(2000, 2050);
			cal1.setPosition(20,-82);
			cal1.draw();
			cal1.setOnClickHandler(selectDate1);
	
			cal2 = new dhtmlxCalendarObject('e_date', false, {isYearEditable: true});
			cal2.setYearsRange(2000, 2050);
			cal2.setPosition(20,-82);
			cal2.draw();
			// cal2.setOnClickHandler(selectDate2);
	
			document.getElementById('e_date').onfocus = function() { if (cal2.isVisible()) cal2.hide(); }
	
			document.body.onclick = function(){calendarHide("cal1,cal2","D");};
		}
	
		function selectDate1(date)
		{
			document.getElementById('e_date').value = cal1.getFormatedDate(null,date);
			dateFrom = new Date(date);
			dateTo = null;
			cal2.setSensitive(dateFrom, dateTo);
			cal1.hide();
			return true;
		}
/////////////////////달력////////////////////////////////////////////////
        function selectChange(type) {
	      
	    	if (type == "group") {
	    	  $("#sgroup").css({backgroundColor:'#3366FF', color:'#FFFFFF'});
	    	  if($("#sgroup").val()=="ALL"){
	    		  $("#sgroup").css({backgroundColor:'#ffffff',color:'#656464'});
	    	  }
				  dojo.event.topic.publish("show_team");	//팀
				  dojo.event.topic.publish("show_emp");	//사원
	    	} else if (type == "team") {
	    		$("#steam").css({backgroundColor:'#3366FF', color:'#FFFFFF'});
	    		if($("#steam").val()=="ALL"){
	    			$("#steam").css({backgroundColor:'#ffffff', color:'#656464'});
		        }
				dojo.event.topic.publish("show_emp");	//사원
	    	}
	    	else if (type == "emp")  {
	    		$("#semp_no").css({backgroundColor:'#3366FF',color:'#FFFFFF'});
	    		if($("#semp_no").val() == "ALL"){
                    $("#semp_no").css({backgroundColor:'#ffffff',color:'#656464'});
		    		}
					//dojo.event.topic.publish("show_emp");	//사원
                          
		    }
			return false;
		}

		function fnc_lateExcel(){
            var f = document.frm;
			
			f.action = "attendLateDetailExcel.action";		//att_struts.xml
			f.submit();
			
			return false;		//페이지 로딩을 없게 한다.
		}

      //성명조회시 키를 눌렀을 때	//disabled=""
		function fnc_searchName(dis) {
			
			if (event.keyCode == 13) {
				
				if (dis.value.length < 1) {
					alert("조회하실 사원명을 입력하시기 바랍니다.") ;
					return false;
				} else {
					frm_search();
					return false;
				}
			}
			
			if (dis.value.length > 0 ) {
				$("#semp_no").attr("disabled" , "disabled");
			} else {
				$("#semp_no").removeAttr('disabled');
			}

			return false;
			
		}

        function frm_search() {
			getList('search');
			return false;
		}
      //조회버튼 클릭시 실행됨.
	//	function fnc_retrieve() {
	//		call_dojo();
	//		return false;
	//	}

	//	//ajax로 조회리스트 호출.
	//    function call_dojo() {
	 //       dojo.event.topic.publish("ajax_list");
	  //      return false;
	  //  }
    
    </script>
	<!-- --------------------J A V A S C R I P T-E N D-------------------- -->
</head>

<body onload="doOnLoad()">
<!--------- Contants Range : STR--------------->
	<div class="fl_ri">
		<div id="contants_box">
			<div id="tit">  
				<span class="fl_ri tit_navi">Home &gt; <span class="f_b">지각조회</span><img src="/images/btl_navi.gif" class="img_tp"></img></span>
				<div class="fl_le"><img src="/images/tit_07.gif" /></div>
			</div>
		<s:form name="frm" id="frm" theme="simple">
		    <s:hidden name="emp_no" 	id="emp_no" value="%{semp_no}" 	/>
			<s:hidden name="emp_nm" 	id="emp_nm" value="%{semp_nm}"	/>
			<s:hidden name="group_no" 	id="group_no" 	/>
			<s:hidden name="group_nm" 	id="group_nm" 	/>
			<s:hidden name="team_no" 	id="team_no" value="%{steam}" 	/>
			
			<s:hidden id="cur_page" name="cur_page"/>
				<!-- -------------------------------------	C O N D I T I O N 	S T A R T------------------------------------- -->
				<div id="search01" > <!--style="border: 1px solid green"-->
				<div id="search_box02"> <!--style="border: 1px solid red"-->
					<ul>
						<li class="txt">근태조회기준일</li>
						<li class="input">
	                              <input type="text" size="12" maxlength="10" name="e_date" id="e_date" value="<s:property value="e_date" />" class="input_100se" style="height:20;background-image:url('images/calendar/calendar.gif');background-repeat:no-repeat;background-position:right 2px;cursor:hand" />						
						</li>
					</ul>
					
					<ul>
						<li class="txt">그룹</li>
		                <li class="input"><s:select name="xGroupNm" cssClass="combobox100se" list="xGroupNm" listKey="xGroupNm"listValue="xGroupNm" /> 
		                   <input type="hidden" name="sgroup"id="sgroup" value="<s:property value="sgroup"/>" />
		                </li>
		                <li class="txt01">팀</li>
		                <li class="input"><s:select name="xTeamNm" cssClass="combobox75se" list="xTeamNm" listKey="xTeamNm" listValue="xTeamNm" /> <input type="hidden" name="steam" id="steam" value="<s:property value="steam"/>" /></li>
		                <li class="txt01">성명</li>
		                <li class="input">
		                    <s:select name="xEmpNm" cssClass="combobox70se" list="xEmpNm" listKey="xEmpNm" listValue="xEmpNm" /> <input type="hidden" name="semp_no" id="semp_no" value="<s:property value="semp_no"/>" /></li>
				
					   <li class="txt01">출근유형</li>
					   <li class="input">
						   <select name="late_absence" class="combobox80se">
							   <option value="ALL" selected>::전체::</option>
							   <option value="0002" class="comboboxVaca">지각</option> 
							   <option value="NN" class="comboboxVaca">결근</option>
						   </select>						
					   </li>
				 </ul>

				<ul class="cebtn">
					<span class="fl_ri">
						<img src="/images/btn_search.gif" style="vertical-align: middle;cursor:pointer;" onclick="return frm_search()" />
						<img src="/images/btn_excel.gif" style="vertical-align: middle;cursor:pointer;"  onclick="fnc_lateExcel()" />
					</span>
				</ul>
			</div>
			</div>	
			<!----------Search_Box : ENd ---------->  
		<!-- ajax로 데이터를 조회해 온다. -->
		</s:form>
		
		
		<s:form name="frm2" id="frm2" theme="simple">
			<s:hidden id="updateArgs" name="updateArgs"/>
			<s:hidden name="ajaxFlag" /><!-- 확인버튼 클릭시 전체 리플러쉬 없앰 -->
			
			<!-- ajax로 데이터를 조회해 온다. -->
			<center>
				<s:url id="ajax_list"  action="attend_detail_late_list_ajax" />
				<s:div id="itemAmtlistDiv" theme="ajax" executeScripts="true" showLoadingText="true" loadingText='<img src="./images/loading_request.gif" />' href="%{ajax_list}" listenTopics="ajax_list" formId="frm" />
			</center>
		</s:form>
		
		<!-- ajax dummy -->
		<s:url id="temp_list"  action="attend_manager_update" />
		<s:div id="tempDiv" theme="ajax" executeScripts="true" showLoadingText="false" href="%{temp_list}" listenTopics="ajaxDojo" formId="frm2" />

		
		</div>
	</div>
</body>
</html>